package com.huaxin.hxmoduleworkorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huaxin.hxmoduleworkorder.models.InspectionOrder;
import com.huaxin.hxmoduleworkorder.models.InspectionOrderStatusCalculationResult;
import io.swagger.v3.oas.annotations.Parameter;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

@Mapper
public interface InspectionOrderMapper extends BaseMapper<InspectionOrder> {
    InspectionOrderStatusCalculationResult calculateStatus(@Parameter(description = "工单ID", name = "orderId") String orderId);

    Page<InspectionOrder> selectPage(Page<InspectionOrder> page,
                                     @Param("title") String title,
                                     @Param("status") String status,
                                     @Param("customerType") String customerType,
                                     @Param("customerId") String customerId,
                                     @Param("electricalRoomId") String electricalRoomId,
                                     @Param("cabinetId") String cabinetId,
                                     @Param("assignedElectricianId") String assignedElectricianId,
                                     @Param("executeStartTime") LocalDateTime executeStartTime,
                                     @Param("executeEndTime") LocalDateTime executeEndTime);
}